<html ng-app="diandanbao" class="ng-scope">
<head>
    <style type="text/css">@charset "UTF-8";
    [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
        display: none !important;
    }
    ng\:form {
        display: block;
    }</style>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
    <title>寄存管理</title>
    <link data-turbolinks-track="true" href="{RES}/mobile/{php echo $this->cur_tpl}/assets/diandanbao/weixin.css?v=1" media="all"
          rel="stylesheet">
    <link rel="stylesheet" href="{php echo $this->cur_mobile_path}/mvalidate/validate.css" />
    <script src="{php echo $this->cur_mobile_path}/script/jquery-1.8.3.min.js"></script>
    <script src="{php echo $this->cur_mobile_path}/script/alertPopShow.js"></script>
    <script type="text/javascript" src="{php echo $this->cur_mobile_path}/mvalidate/jquery-mvalidate.js" ></script>
    <style>
        @charset "UTF-8";
        /* rem */
        @media only screen and (max-width:1080px),only screen and (max-device-width:1080px){
            html{font-size:33.75px;}
        }
        @media only screen and (max-width:960px),only screen and (max-device-width:960px){
            html{font-size:30px;}
        }
        @media only screen and (max-width:800px),only screen and (max-device-width:800px){
            html{font-size:25px;}
        }
        @media only screen and (max-width:720px),only screen and (max-device-width:720px){
            html{font-size:22.5px;}
        }
        @media only screen and (max-width:640px),only screen and (max-device-width:640px){
            html{font-size:20px;}
        }
        @media only screen and (max-width:600px),only screen and (max-device-width:600px){
            html{font-size:18.75px;}
        }
        @media only screen and (max-width:540px),only screen and (max-device-width:540px){
            html{font-size:16.875px;}
        }
        @media only screen and (max-width:480px),only screen and (max-device-width:480px){
            html{font-size:15px;}
        }
        @media only screen and (max-width:414px),only screen and (max-device-width:414px){
            html{font-size:12.9375px;}
        }
        @media only screen and (max-width:400px),only screen and (max-device-width:400px){
            html{font-size:12.5px;}
        }
        @media only screen and (max-width:375px),only screen and (max-device-width:375px){
            html{font-size:11.71875px;}
        }
        @media only screen and (max-width:360px),only screen and (max-device-width:360px){
            html{font-size:11.25px;}
        }
        @media only screen and (max-width:320px),only screen and (max-device-width:320px){
            html{font-size:10px;}
        }

        @media only screen and (max-width:240px),only screen and (max-device-width:240px){
            html{font-size:7.5px;}
        }
        /* ============================================================
           样式重置
           ============================================================ */
        body,p,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,form,fieldset,legend,input,select,textarea,button,th,td{margin:0;padding:0;}
        h1,h2,h3,h4,h5,h6{font-size:100%;}
        ul,dl,ol{list-style:none;}
        img,fieldset,input[type="submit"]{border:0 none;}
        img{display:inline-block;overflow:hidden;vertical-align:top;}
        em{font-style:normal;}
        strong{font-weight:normal;}
        table{border-collapse:collapse;border-spacing:0;}
        button,input[type="button"]{cursor:pointer;border:0 none;}
        textarea{word-wrap:break-word;resize:none;}  /* word-wrap for opera, resize for webkit */
        menu{margin:0;padding:0;}
        body{-webkit-user-select:none;-webkit-text-size-adjust:100%!important;font-family:Helvetica;}
        input[type="number"]{-webkit-user-select:text;}
        a,button,input,img{-webkit-touch-callout:none;}/* 1.ios 长按时不触发系统的菜单 2.禁止长按时下载图片 */
        input,select,textarea{outline:none;}
        /* 去除android4.0以下 a/button/input标签被点击时产生的边框 因为边框引起了不少bug */
        a,button,input,label{-webkit-tap-highlight-color:rgba(0,0,0,0);}
        /* Android4.0下不识别选择器-webkit-transform-3d 使用它可做Android4.0下版本兼容 */
        @media all and (-webkit-transform-3d){
            /* android4.0+ ios4+ 恢复按钮被点击时产生的效果 */
            a,button,input,label{-webkit-tap-highlight-color:rgba(130,130,130,.52);outline: none;}
        }
        html,body{height:100%;margin: 0 auto;max-width: 640px;background-color: #eaeaee;}
        a{text-decoration:none;}
        .clear{clear:both;}
        .clearleft{float:left;display: inline;}
        .clearright{float:right;display: inline;}
        .hide{display: none!important;}


        .demo{
            border-top: 1px solid #fff;
            border-bottom: 1px solid #D5D5D6;
            border-radius: 3px;
            padding: 12px;
            font-size: 20px;
            color: #666;
            text-align: center;
        }


        /* flex */
        .flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
        .flex-v{-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
        .flex-1{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;}
        .flex-align-center{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;}
        .flex-pack-center{-webkit-box-pack:center;-webkit-justify-content:flex-start;-ms-flex-pack:center;justify-content:flex-start;}
        .flex-pack-justify{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
        .flex-box { display: -webkit-box;display: -moz-box;display: -ms-flexbox;display: -webkit-flex;display: flex;-moz-box-orient: horizontal;-webkit-box-orient: horizontal;-o-box-orient: horizontal;box-orient: horizontal;}
        /*遮罩*/
        .mask{position: fixed;width: 100%;height: 100%;left: 0;top: 0;bottom: 0;background-color: rgba(0,0,0,0.8);z-index: 999;}

        /* 错误提示弹层 */
        .c-float-modePop {
            text-align: center;
            background-color: #FAFAFC;
        }
        .c-float-modePop .warnMsg {

            padding: 20px 10px 10px 10px;
            color: #fff
        }
        .c-float-modePop .doBtn {

            width: 100%;
            margin: 0 auto;
        }
        .c-float-modePop button {

            padding: 6px 9px 6px 9px;
            color: #949494;
            border: 0;
        }
        .c-float-shade {

            width: 100%;
            display: block;
            position: absolute;
            z-index: 99;
            background-color: #000;
            opacity: .5;
            top: 0;
            left: 0
        }
        .c-float-shade.hide {
            display: none
        }
        .c-float-popWrap {
            width: 85%;
            z-index: 9999;
            position: fixed;
            /*position: initial;*/
            border-radius: 3px;
            overflow: hidden;
        }
        .c-float-popWrap .c-float-modePop {
            overflow: hidden;
            border-radius: 6px;
        }
        .c-float-popWrap .c-float-modePop .warnMsg {
            padding: 0.8em 0 0.8em;
            font-size: 15px;
            color: #333;
        }
        .c-float-popWrap .c-float-modePop .content {
            padding: 0 20px;
            font-size: 14px;
            color: #888;
            word-wrap: break-word;
            word-break: break-all;
            text-align: left;
        }
        .c-float-popWrap .c-float-modePop .doBtn {
            width: 100%;
            margin-top: 15px;
            position: relative;
        }
        .c-float-popWrap .c-float-modePop .doBtn:after {
            content: " ";
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 1px;
            border-top: 1px solid #D5D5D6;
            color: #D5D5D6;
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
            -webkit-transform: scaleY(0.5);
            transform: scaleY(0.5);
        }
        .c-float-popWrap .c-float-modePop button {
            background-color: #FAFAFC;
            width: 50%;
            height: 42px;
            line-height: 42px;
            color: #444;
            font-size: 17px;
            border: 0;
            padding: 0;
        }
        .c-float-popWrap .c-float-modePop button.ok{
            color: #0BB20C;
        }
        .c-float-popWrap .c-float-modePop button.cancel{
            position: relative;
        }
        .c-float-popWrap .c-float-modePop button.cancel:after {
            content: " ";
            position: absolute;
            right: -1px;
            top: 0;
            width: 1px;
            height: 100%;
            border-left: 1px solid #D5D5D6;
            color: #D5D5D6;
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
            -webkit-transform: scaleX(0.5);
            transform: scaleX(0.5);
        }
        .c-float-popWrap.hide {

            display: none;
            -webkit-box-shadow: none
        }
        .c-float-popWrap.show {

            display: block;
        }

        .c-float-popWrap.msgMode .c-float-modePop .content, .c-float-popWrap.msgMode .c-float-modePop .doBtn {

            display: none
        }

        .c-float-popWrap.alertMode .c-float-modePop .doBtn .cancel {

            display: none
        }
        .c-float-popWrap.confirmMode .c-float-modePop .content, .c-float-popWrap.confirmMode .c-float-modePop .doBtn {

            display: block
        }

        .confirm_input{
            border: 1px solid #D5D5D6;
            padding: 10px;
            width: 70%;
        }
        .weui_mask_transparent {
            position: fixed;
            z-index: -1;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background: rgba(0, 0, 0, 0.2);
        }
        .cx_mask_transparent{
            position: fixed;
            z-index: -1;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background: rgba(255, 255, 255, 0.1);
        }

        .web_toast{
            position: fixed;
            margin: 0 10px;
            z-index: 9999;
            display: none;
            display: block;
            padding: 10px;
            color: #FFFFFF;
            background: rgba(0, 0, 0, 0.7);
            font-size: 1.4rem;
            text-align: center;
            border-radius: 4px;
        }
    </style>
</head>
<body>
<div style="height: 100%;" class="ng-scope">
    <div class="ddb-nav-header ng-scope"  style="background-color: {$setting['style_base']};border-bottom: 1px solid {$setting['style_base']};">
        <div class="nav-left-item" onclick="jump();"><i class="fa fa-angle-left"></i></div>
        <div class="header-title ng-binding">寄存管理</div>
    </div>

    <div class="main-view order-show ng-scope" id="delivery-order-show" style="height: 100%;">
        <div class="section">
            <a class="list-item arrow-right ng-binding" href="{php echo $this->createMobileUrl('detail', array('id' => $store['id']), true)}">
                <i class="fa fa-bookmark-o"></i> {$store['title']}
            </a>
            <a class="list-item arrow-right ng-binding" href="tel:{$store['tel']}">
                <i class="fa fa-phone"></i> 商家客服：{$store['tel']}
            </a>
        </div>
        <div class="space-8"></div>

        <div class="order-state-section ng-scope">
            <div class="order-state ng-isolate-scope active">
                <div class="order-state-header">
                    <div class="square">
                        <div class="line-through ng-hide" ng-hide="hide_left"></div>
                    </div>
                    <i class="fa fa-check-circle"></i>

                    <div class="square">
                        <div class="line-through" ng-hide="hide_right"></div>
                    </div>
                </div>
                <div class="order-state-body ng-binding">等待存入</div>
            </div>
            <div class="order-state ng-isolate-scope {if $order['status']==1 || $order['status']==-1}active{/if}">
                <div class="order-state-header">
                    <div class="square">
                        <div class="line-through" ng-hide="hide_left"></div>
                    </div>
                    <i class="fa fa-check-circle"></i>

                    <div class="square">
                        <div class="line-through" ng-hide="hide_right"></div>
                    </div>
                </div>
                <div class="order-state-body ng-binding">已存入</div>
            </div>
            <div class="order-state ng-isolate-scope {if $order['status']==-1}active{/if}">
                <div class="order-state-header">
                    <div class="square">
                        <div class="line-through" ng-hide="hide_left"></div>
                    </div>
                    <i class="fa fa-check-circle"></i>

                    <div class="square">
                        <div class="line-through ng-hide" ng-hide="hide_right"></div>
                    </div>
                </div>
                <div class="order-state-body ng-binding">已取出</div>
            </div>
        </div>
        <div class="space-8"></div>
        <div class="section no-bottom-border">
            {loop $order['goods'] $item}
            <div class="list-item ng-scope">
                <div class="name ng-binding">
                    {$item['title']}
                </div>
                <div class="name ng-binding" style="font-size: 12px;color: #f00;">
                    {if $item['savetime']>0}
                    过期时间<br/>{php echo date('Y-m-d H:i:s',$item['savetime'])}
                    {/if}
                    {if $item['takeouttime']>0}
                    <div style="color: #28a267;">
                    取出时间
                    <br/>
                    {php echo date('Y-m-d H:i:s',$item['takeouttime'])}
                    </div>
                    {/if}
                </div>
                <div class="quantity-info">
                    <span class="quantity ng-binding">数量{$item['total']}</span>
                </div>
                <div class="total-info">
                    {if $order['status']==0}
                    <span class="button border-green" onclick="">待存入</span>
                    {else}

                    {if $item['status'] == 1}
                    {if $item['savetime']>0}
                        {if $item['savetime']>TIMESTAMP}
                            <span class="button border-green demo4" data-id="{$item['id']}" style="border-width: 0px;">待取出</span>
                        {else}
                            <span class="button border-red" style="border-width: 0px;">已过期</span>
                        {/if}
                    {else}
                    <span class="button border-green demo4" data-id="{$item['id']}" style="border-width: 0px;">待取出</span>
                    {/if}
                    {elseif $item['status'] == -1}
                    <span class="button border-red" style="border-width: 0px;">已取出</span>
                    {/if}
                    {/if}
                </div>
            </div>
            {/loop}
            {if $order['status']==1}
            <div class="list-item time">
                <!--<span class="button border-green"  onclick="postmain(0);">全部取出</span>-->
            </div>
            {/if}
        </div>
        <div class="section no-bottom-border">
            <div class="list-item ng-scope">
                <div class="ng-binding">申请时间：{php echo date('Y-m-d H:i:s',$order['dateline'])}</div>
            </div>
            {if !empty($order['savetime'])}
            <div class="list-item ng-scope">
                <div class="ng-binding">存入时间：{php echo date('Y-m-d H:i:s',$order['savetime'])}</div>
            </div>
            {/if}
            {if !empty($order['takeouttime'])}
            <div class="list-item ng-scope">
                <div class="ng-binding">取出时间：{php echo date('Y-m-d H:i:s',$order['takeouttime'])}</div>
            </div>
            {/if}
            <div class="list-item ng-scope">
                <div class="name ng-binding">
                    卡号：{$order['savenumber']}
                </div>
                <div class="name ng-binding" style="color: #f00;font-size: 18px;">
                    存酒桌台：{$table_title}
                </div>
            </div>
            <!--<div class="list-item ng-scope">-->
                <!--<div class="name ng-binding">-->
                    <!--物品：{$order['title']}-->
                <!--</div>-->
            <!--</div>-->
            <div class="list-item ng-scope">
                <div class="name ng-binding">
                    姓名: {$order['username']}
                </div>
                <div class="name ng-binding">
                    电话: {$order['tel']}
                </div>
            </div>
            {if !empty($order['remark'])}
            <div class="list-item">
                <div class="name ng-binding">
                    备注: {$order['remark']}
                </div>
            </div>
            {/if}
            <div class="juchi"></div>
        </div>
        {loop $loglist $item}
        <div class="section no-bottom-border">
            <div class="list-item ng-scope">
                {if $item['type']==1}
                <div class="ng-binding" style="color: #f34b3f">取出时间：{php echo date('Y-m-d H:i:s',$item['dateline'])}</div>
                {else}
                <div class="ng-binding" style="color: #28a267">存入时间：{php echo date('Y-m-d H:i:s',$item['dateline'])}</div>
                {/if}
            </div>
            <div class="list-item ng-scope">
                <div class="name ng-binding">
                    物品：{$item['title']}
                </div>
                <div class="name ng-binding">
                    数量：{$item['total']}
                </div>
            </div>
        </div>

        {/loop}
    </div>
</div>
<script>
    function postmain(id , total) {
        var url = "{php echo $this->createMobileUrl('getsavewine', array('storeid' => $storeid), true)}";
        savewineid = {$order['id']};

        data = {
            "goodsid" : id,
            "savewineid": savewineid,
            "total":total
        };

        $.ajax({
            url: url, type: "post", dataType: "json", timeout: "10000",
            data: data,
            success: function (data) {
                if (data.status == 1) {
                    window.location.reload();
                } else {
                    $.mvalidateTip(data.msg);
                }
            },error: function () {
                $.mvalidateTip("网络不稳定，请重新尝试!");
            }
        });
    }

    $('.demo4').on('click', function(){
        return false;
        var id = $(this).attr("data-id");

        var html = "<label>数量：<input class='confirm_input' placeholder='请输入'></label>";
        popTipShow.confirm('取出存酒',html,['确 定','取 消'],
                function(e){
                    //callback 处理按钮事件
                    var button = $(e.target).attr('class');
                    if(button == 'ok'){
                        if(null==$(".confirm_input").val() || ""==$(".confirm_input").val()){
                            webToast("数量不能为空！","bottom", 3000);
                            return;
                        }

                        this.hide();
                        setTimeout(function() {
                            webToast($(".confirm_input").val(),"bottom", 3000);
                        }, 300);

                        postmain(id , $(".confirm_input").val());
                        //按下确定按钮执行的操作
                        //todo ....
                    }

                    if(button == 'cancel') {
                        //按下取消按钮执行的操作
                        //todo ....
                        this.hide();
//                        setTimeout(function() {
//                            webToast("您选择“取消”了","top", 2000);
//                        }, 300);
                    }
                }
        );
    });
</script>
</body>
</html>